<?php
namespace app\index\model;

use think\Model;

class MessageModel extends Model
{

    protected $table = 'newzs_message';


    /**
     * @param $tel
     * @param $type
     * @param $code
     * @return MessageModel
     */
    public static function add_message($tel, $code){
        date_default_timezone_set("Asia/Shanghai");
        $data = [
            'tel' => $tel,
            'code' => $code,
            'expirydt' => date('Y-m-d H:i:s', time()+180),
            'status' => 1,
        ];
        return self::create($data);
    }


}
